import request from '@/router/axios';

export const getDeptTree = () => {
  return request({
    url: '/api/dept/tree',
    method: 'post'
  })
}

export const getList = (page, size, params) => {
  return request({
    url: '/api/dept/list',
    method: 'post',
    params: {
        // condition:params.condition,
        // deptId:params.deptId,
        condition:params.simpleName,
      page,
      size,
    }
  })
}
export const remove = (deptId) => {
  return request({
    url: '/api/dept/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      deptId,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/dept/add',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/dept/update',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const getDept = (deptId) => {
  return request({
    url: `/api/dept/view/${deptId}`,
    method: 'post',
    meta: {
      isSerialize: true,
    }
  })
}